﻿using System.IO;
using System.Text;
using System.Xml.Serialization;

namespace Renci.Data.Interop.Test.OpenGIS
{
    public static class Common
    {
        public static void TestSerialization<T>(string sourceXml)
        {
            //var serializer = new Renci.Data.Interop.Serialization.InteropSerializer(typeof(T));
            var serializer = new XmlSerializer(typeof(T));
            var item = (T)serializer.Deserialize(new StringReader(sourceXml));
            StringBuilder sb = new StringBuilder();
            StringWriter sw = new StringWriter(sb);
            serializer.Serialize(sw, item);
            XmlAssert.AreEqual(sourceXml, sb.ToString());
        }
    }
}
